package com.lehecai.core.lottery.fetcher.jcgyj.impl;

import java.util.List;

import com.lehecai.core.exception.FetchFailedException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.lehecai.core.lottery.LotteryType;
import com.lehecai.core.lottery.fetcher.FetcherType;
import com.lehecai.core.lottery.fetcher.jcgyj.JcgyjStaticInstantSpItem;
import com.lehecai.core.lottery.fetcher.jcgyj.impl.worker.JcgyjStaticVirtualInstantSpFetchWorkerPengineAPI;

public class JcgyjStaticVirtualInstantSPFetcher extends BaseJcgyjStaticInstantSpFetcher {

	protected final Logger logger = LoggerFactory.getLogger(this.getClass().getName());

	@Override
	protected FetcherType getDefaultFetcherType() {
		return FetcherType.T_PENGINEAPI;
	}

    /**
     * 从engineAPI虚拟功能抓取竞彩冠亚军即时sp
     * @param phase
     * @param lotteryType
     * @return
     */
    protected List<JcgyjStaticInstantSpItem> fetchPengineAPI(String phase, LotteryType lotteryType){
		JcgyjStaticVirtualInstantSpFetchWorkerPengineAPI worker = new JcgyjStaticVirtualInstantSpFetchWorkerPengineAPI();
        try {
            return worker.fetch(phase,lotteryType);
        } catch (FetchFailedException e) {
            logger.error(e.getMessage(), e);
            return null;
        }
    }

}
